<!--  -->
<template>
  <div class="area">
    <div class="header">
      <van-icon name="arrow-left" size="18" @click="goBack()" />
      <p>区域筛选</p>
      <span></span>
    </div>
    <div class="content">
      <div class="search">
        <select name="" id="">
          <option value="">北京</option>
          <option value="">上海</option>
          <option value="">深圳</option>
        </select>
        <van-search
          v-model="search"
          placeholder="请在这里输入区域/商圈"
          @search="onSearch"
          right-icon="search"
          left-icon=""
        />
        <p @click="gofindHome()">地图找房</p>
      </div>
      <div class="classify">
        <ul>
          <li class="active">区域<van-icon name="arrow-down" size="13" /></li>
          <li @click="goPrice()">
            价格<van-icon name="arrow-down" size="13" />
          </li>
          <li @click="gohouseType()">
            户型<van-icon name="arrow-down" size="13" />
          </li>
          <li @click="goScreen()">
            筛选<van-icon name="arrow-down" size="13" />
          </li>
          <li><van-icon name="sort" /></li>
        </ul>
      </div>
      <div class="condition">
        <van-area
          title="标题"
          :area-list="areaList"
          :columns-placeholder="['请选择', '请选择', '请选择']"
        />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  // 组件状态值
  data() {
    return {
      search: "",
      areaList: {
        province_list: {
          110000: "北京市",
          120000: "天津市",
          130000: "河北省",
        },
        city_list: {
          110100: "北京市",
          120100: "天津市",
          130100: "石家庄市",
          130200: "唐山市",
          130300: "保定市",
        },
        county_list: {
          110101: "东城区",
          110102: "西城区",
          110103: "朝阳区",
          110104: "海淀区",
          110105: "房山区",
          120101: "和平区",
          120102: "河东区",
          120103: "河西区",
          120104: "南开区",
          120105: "红桥区",
          120106: "北辰区",
          130101: "长安区",
          130102: "新华区",
          130103: "桥西区",
          130104: "鹿泉区",
          130105: "栾城区",
          130201: "路南区",
          130202: "路北区",
          130203: "古冶区",
          130204: "开平区",
          130205: "滦南县",
          130301: "竞秀区",
          130302: "莲池区",
          130303: "满城区",
          130304: "清苑区",
          130305: "徐水区",
        },
      },
    };
  },
  // 计算属性
  computed: {},
  // 组件方法
  methods: {
    //返回二手房界面
    goBack() {
      this.$router.push("/resoldHome");
    },
    //跳转到价格筛选页面
    goPrice() {
      this.$router.push("/price");
    },
    //跳转到户型筛选页面
    gohouseType() {
      this.$router.push("/houseType");
    },
    //跳转到筛选页面
    goScreen() {
      this.$router.push("/screen");
    },
    //跳转到地图找房页面
    gofindHome() {
      this.$router.push("/findHome");
    },
    //搜索
    onSearch() {},
  },
  /**
   * 组件实例创建完成，属性已绑定，但DOM还未生成，$ el属性还不存在
   */
  created() {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<!--使用了scoped属性之后，父组件的style样式将不会渗透到子组件中，-->
<!--然而子组件的根节点元素会同时被设置了scoped的父css样式和设置了scoped的子css样式影响，-->
<!--这么设计的目的是父组件可以对子组件根元素进行布局。-->
<style lang="scss" scoped>
.area {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.header {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  color: #fff;
  background: #4381e6;
  padding: 0 15px;
}
.content {
  width: 100%;
  height: 100%;
}
.search {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  .van-search__content {
    border: 1px solid #ddd;
  }
  select {
    width: 55px;
    border: 0;
    outline: 0;
  }
  p {
    font-size: 15px;
  }
}
.classify {
  width: 100%;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  ul {
    display: flex;
    justify-content: space-around;
    line-height: 40px;
    .van-icon {
      margin-left: 3px;
    }
    .active {
      color: orange;
    }
  }
}
</style>
